Contents | Index | < Browse | Browse >

LETTERva_argULETTER Gets an argument from a varying-length argument list.

Overview
#include <stdarg.h>

r = va_arg(vl,TYPE);

TYPE r; // the function's next argument
va_list vl; // argument list
TYPE; // argument type
Portability
ANSI

Description
Gets the value of the next argument out of a varying-length argument list. Its type must be known, eg. through a format template as used by printf and scanf.

Before using this macro the argument list must be previously initialized by a call to va_start. After the last argument the argument list must be freed by va_end.

Returns
The value of the next argument.

See also
va_start , va_end